package com.sap.tpcd.policybuilder.policymodel ;


/**
 * @author I068988
 * @version 1.0
 * @created 30-sept.-2011 14:12:37
 */
public class Interfaces extends PolicyElement {

	private int bandwidth;
	private String gatewayAdress;
	private String name;
	private String subnet;

	public Interfaces(){
		super();
	}

	public boolean isMapped(){
		return false;
	}

	public Interfaces(int bandwidth, String gatewayAdress, String name,
			String subnet) {
		super();
		this.bandwidth = bandwidth;
		this.gatewayAdress = gatewayAdress;
		this.name = name;
		this.subnet = subnet;
	}
	

	/**
	 * @return the bandwidth
	 */
	public int getBandwidth() {
		return bandwidth;
	}

	/**
	 * @param bandwidth the bandwidth to set
	 */
	public void setBandwidth(int bandwidth) {
		this.bandwidth = bandwidth;
	}

	/**
	 * @return the gatewayAdress
	 */
	public String getGatewayAdress() {
		return gatewayAdress;
	}

	/**
	 * @param gatewayAdress the gatewayAdress to set
	 */
	public void setGatewayAdress(String gatewayAdress) {
		this.gatewayAdress = gatewayAdress;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the subnet
	 */
	public String getSubnet() {
		return subnet;
	}

	/**
	 * @param subnet the subnet to set
	 */
	public void setSubnet(String subnet) {
		this.subnet = subnet;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + bandwidth;
		result = prime * result
				+ ((gatewayAdress == null) ? 0 : gatewayAdress.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((subnet == null) ? 0 : subnet.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (!(obj instanceof Interfaces)) {
			return false;
		}
		Interfaces other = (Interfaces) obj;
		if (bandwidth != other.bandwidth) {
			return false;
		}
		if (gatewayAdress == null) {
			if (other.gatewayAdress != null) {
				return false;
			}
		} else if (!gatewayAdress.equals(other.gatewayAdress)) {
			return false;
		}
		if (name == null) {
			if (other.name != null) {
				return false;
			}
		} else if (!name.equals(other.name)) {
			return false;
		}
		if (subnet == null) {
			if (other.subnet != null) {
				return false;
			}
		} else if (!subnet.equals(other.subnet)) {
			return false;
		}
		return true;
	}

	
}